<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>IgH EtherCAT Master: datagram_pair.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">IgH EtherCAT Master
   &#160;<span id="projectnumber">1.5.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('datagram__pair_8c_source.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">datagram_pair.c</div>  </div>
</div><!--header-->
<div class="contents">
<a href="datagram__pair_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/******************************************************************************</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *  $Id: datagram_pair.c,v ec403cf308eb 2013/02/12 14:46:43 fp $</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *  Copyright (C) 2006-2012  Florian Pose, Ingenieurgemeinschaft IgH</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> *  This file is part of the IgH EtherCAT Master.</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> *  The IgH EtherCAT Master is free software; you can redistribute it and/or</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *  modify it under the terms of the GNU General Public License version 2, as</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> *  published by the Free Software Foundation.</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *  The IgH EtherCAT Master is distributed in the hope that it will be useful,</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> *  but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> *  Public License for more details.</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> *  You should have received a copy of the GNU General Public License along</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> *  with the IgH EtherCAT Master; if not, write to the Free Software</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> *  ---</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"> *  The license mentioned above concerns the source code only. Using the</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment"> *  EtherCAT technology and brand is only permitted in compliance with the</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment"> *  industrial property and similar rights of Beckhoff Automation GmbH.</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment"> *****************************************************************************/</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#include &lt;linux/slab.h&gt;</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="master_8h.html">master.h</a>&quot;</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="datagram__pair_8h.html">datagram_pair.h</a>&quot;</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="datagram__pair_8h.html#ad68c9cbef047c62f692646025db09f80">   48</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="datagram__pair_8c.html#a0b3a11d04d7bcb1f5db4187ff628d4bd">ec_datagram_pair_init</a>(</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;        <a class="code" href="structec__datagram__pair__t.html">ec_datagram_pair_t</a> *pair, </div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;        <a class="code" href="structec__domain.html">ec_domain_t</a> *domain, </div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;        uint32_t logical_offset, </div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;        uint8_t *data, </div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;        <span class="keywordtype">size_t</span> data_size, </div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> used[] </div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;        )</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;{</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    <a class="code" href="globals_8h.html#ad1a2101422888687598d7e1a630c6343">ec_device_index_t</a> dev_idx;</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <span class="keywordtype">int</span> ret;</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    INIT_LIST_HEAD(&amp;pair-&gt;<a class="code" href="structec__datagram__pair__t.html#a8b2eafeceb6565bfe2d0c2363679ba1e">list</a>);</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    pair-&gt;<a class="code" href="structec__datagram__pair__t.html#aaaa75d1c846028cdd78be790c82a9e31">domain</a> = domain;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <span class="keywordflow">for</span> (dev_idx = <a class="code" href="globals_8h.html#ad1a2101422888687598d7e1a630c6343a6cc7c24499003f339df547ab73605f13">EC_DEVICE_MAIN</a>;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;            dev_idx &lt; <a class="code" href="master_8h.html#a27e6deff35543c304e8a191c64f35cf3">ec_master_num_devices</a>(domain-&gt;<a class="code" href="structec__domain.html#a58e4f4b7d54f30e58c7187268c1525c1">master</a>); dev_idx++) {</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;        <a class="code" href="datagram_8c.html#af3dd26022b8780648d2f96ef558f0657">ec_datagram_init</a>(&amp;pair-&gt;<a class="code" href="structec__datagram__pair__t.html#a3984a280ea726795e9402bc7363d05ed">datagrams</a>[dev_idx]);</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;        snprintf(pair-&gt;<a class="code" href="structec__datagram__pair__t.html#a3984a280ea726795e9402bc7363d05ed">datagrams</a>[dev_idx].<a class="code" href="structec__datagram__t.html#af2690854e7fb1c410aa37a1ed225836d">name</a>,</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;                <a class="code" href="globals_8h.html#ac67cff75d900b9f1112a4c1a635e495d">EC_DATAGRAM_NAME_SIZE</a>, <span class="stringliteral">&quot;domain%u-%u-%s&quot;</span>, domain-&gt;<a class="code" href="structec__domain.html#ac341000021b5790693cc74f7687fb956">index</a>,</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;                logical_offset, <a class="code" href="globals_8h.html#ab60dd3400b4ae7f326c3edb327505829">ec_device_names</a>[dev_idx != 0]);</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;        pair-&gt;<a class="code" href="structec__datagram__pair__t.html#a3984a280ea726795e9402bc7363d05ed">datagrams</a>[dev_idx].<a class="code" href="structec__datagram__t.html#a9804c4ebdbd3e7ff5b55bfe3aa33bbef">device_index</a> = dev_idx;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    }</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    pair-&gt;<a class="code" href="structec__datagram__pair__t.html#aa6e12e670f12a511f108b9cd7974f1ce">expected_working_counter</a> = 0U;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    <span class="keywordflow">for</span> (dev_idx = <a class="code" href="globals_8h.html#ad1a2101422888687598d7e1a630c6343ab269739586dbb817c1e0ff42e74c5111">EC_DEVICE_BACKUP</a>;</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;            dev_idx &lt; <a class="code" href="master_8h.html#a27e6deff35543c304e8a191c64f35cf3">ec_master_num_devices</a>(domain-&gt;<a class="code" href="structec__domain.html#a58e4f4b7d54f30e58c7187268c1525c1">master</a>); dev_idx++) {</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        <span class="comment">/* backup datagrams have their own memory */</span></div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        ret = <a class="code" href="datagram_8c.html#a407dc1f0c4247f84e4193b4368be8a8b">ec_datagram_prealloc</a>(&amp;pair-&gt;<a class="code" href="structec__datagram__pair__t.html#a3984a280ea726795e9402bc7363d05ed">datagrams</a>[dev_idx], data_size);</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;        <span class="keywordflow">if</span> (ret) {</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;            <span class="keywordflow">goto</span> out_datagrams;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;        }</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    }</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<span class="preprocessor">#if EC_MAX_NUM_DEVICES &gt; 1</span></div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <span class="keywordflow">if</span> (!(pair-&gt;send_buffer = kmalloc(data_size, GFP_KERNEL))) {</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;        <a class="code" href="master_8h.html#aece1fb7ea6af168ba7513c9d7b0a523a">EC_MASTER_ERR</a>(domain-&gt;<a class="code" href="structec__domain.html#a58e4f4b7d54f30e58c7187268c1525c1">master</a>,</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;                <span class="stringliteral">&quot;Failed to allocate domain send buffer!\n&quot;</span>);</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        ret = -ENOMEM;</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;        <span class="keywordflow">goto</span> out_datagrams;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    }</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    <span class="comment">/* The ec_datagram_lxx() calls below can not fail, because either the</span></div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;<span class="comment">     * datagram has external memory or it is preallocated. */</span></div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    <span class="keywordflow">if</span> (used[<a class="code" href="group__ApplicationInterface.html#gga703c4e47384b3601e7605d6d910aaba1aebf26f1d5c09cf002af5b09d9cb59b78">EC_DIR_OUTPUT</a>] &amp;&amp; used[<a class="code" href="group__ApplicationInterface.html#gga703c4e47384b3601e7605d6d910aaba1a6b3c6b53010076d846724fec434512e4">EC_DIR_INPUT</a>]) { <span class="comment">// inputs and outputs</span></div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;        <a class="code" href="datagram_8c.html#a28e3b0846186d09fbb8c4166c4a6eaba">ec_datagram_lrw_ext</a>(&amp;pair-&gt;<a class="code" href="structec__datagram__pair__t.html#a3984a280ea726795e9402bc7363d05ed">datagrams</a>[<a class="code" href="globals_8h.html#ad1a2101422888687598d7e1a630c6343a6cc7c24499003f339df547ab73605f13">EC_DEVICE_MAIN</a>],</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;                logical_offset, data_size, data);</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;        <span class="keywordflow">for</span> (dev_idx = <a class="code" href="globals_8h.html#ad1a2101422888687598d7e1a630c6343ab269739586dbb817c1e0ff42e74c5111">EC_DEVICE_BACKUP</a>;</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;                dev_idx &lt; <a class="code" href="master_8h.html#a27e6deff35543c304e8a191c64f35cf3">ec_master_num_devices</a>(domain-&gt;<a class="code" href="structec__domain.html#a58e4f4b7d54f30e58c7187268c1525c1">master</a>); dev_idx++) {</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;            <a class="code" href="datagram_8c.html#ae8724f060b07cdbed10a0e264d066094">ec_datagram_lrw</a>(&amp;pair-&gt;<a class="code" href="structec__datagram__pair__t.html#a3984a280ea726795e9402bc7363d05ed">datagrams</a>[dev_idx],</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;                    logical_offset, data_size);</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;        }</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;        <span class="comment">// If LRW is used, output FMMUs increment the working counter by 2,</span></div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        <span class="comment">// while input FMMUs increment it by 1.</span></div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;        pair-&gt;<a class="code" href="structec__datagram__pair__t.html#aa6e12e670f12a511f108b9cd7974f1ce">expected_working_counter</a> =</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;            used[<a class="code" href="group__ApplicationInterface.html#gga703c4e47384b3601e7605d6d910aaba1aebf26f1d5c09cf002af5b09d9cb59b78">EC_DIR_OUTPUT</a>] * 2 + used[<a class="code" href="group__ApplicationInterface.html#gga703c4e47384b3601e7605d6d910aaba1a6b3c6b53010076d846724fec434512e4">EC_DIR_INPUT</a>];</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (used[<a class="code" href="group__ApplicationInterface.html#gga703c4e47384b3601e7605d6d910aaba1aebf26f1d5c09cf002af5b09d9cb59b78">EC_DIR_OUTPUT</a>]) { <span class="comment">// outputs only</span></div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;        <a class="code" href="datagram_8c.html#a5ccd1a04e0901c0bc716b4d7f3dd676d">ec_datagram_lwr_ext</a>(&amp;pair-&gt;<a class="code" href="structec__datagram__pair__t.html#a3984a280ea726795e9402bc7363d05ed">datagrams</a>[<a class="code" href="globals_8h.html#ad1a2101422888687598d7e1a630c6343a6cc7c24499003f339df547ab73605f13">EC_DEVICE_MAIN</a>],</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;                logical_offset, data_size, data);</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;        <span class="keywordflow">for</span> (dev_idx = <a class="code" href="globals_8h.html#ad1a2101422888687598d7e1a630c6343ab269739586dbb817c1e0ff42e74c5111">EC_DEVICE_BACKUP</a>;</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;                dev_idx &lt; <a class="code" href="master_8h.html#a27e6deff35543c304e8a191c64f35cf3">ec_master_num_devices</a>(domain-&gt;<a class="code" href="structec__domain.html#a58e4f4b7d54f30e58c7187268c1525c1">master</a>); dev_idx++) {</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;            <a class="code" href="datagram_8c.html#aadace5dd3018b8cbcd8f3905a086ea9d">ec_datagram_lwr</a>(&amp;pair-&gt;<a class="code" href="structec__datagram__pair__t.html#a3984a280ea726795e9402bc7363d05ed">datagrams</a>[dev_idx],</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;                    logical_offset, data_size);</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;        }</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;        pair-&gt;<a class="code" href="structec__datagram__pair__t.html#aa6e12e670f12a511f108b9cd7974f1ce">expected_working_counter</a> = used[<a class="code" href="group__ApplicationInterface.html#gga703c4e47384b3601e7605d6d910aaba1aebf26f1d5c09cf002af5b09d9cb59b78">EC_DIR_OUTPUT</a>];</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    } <span class="keywordflow">else</span> { <span class="comment">// inputs only (or nothing)</span></div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        <a class="code" href="datagram_8c.html#a5469e87537d8c03970d1981984cf4b38">ec_datagram_lrd_ext</a>(&amp;pair-&gt;<a class="code" href="structec__datagram__pair__t.html#a3984a280ea726795e9402bc7363d05ed">datagrams</a>[<a class="code" href="globals_8h.html#ad1a2101422888687598d7e1a630c6343a6cc7c24499003f339df547ab73605f13">EC_DEVICE_MAIN</a>],</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;                logical_offset, data_size, data);</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;        <span class="keywordflow">for</span> (dev_idx = <a class="code" href="globals_8h.html#ad1a2101422888687598d7e1a630c6343ab269739586dbb817c1e0ff42e74c5111">EC_DEVICE_BACKUP</a>;</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;                dev_idx &lt; <a class="code" href="master_8h.html#a27e6deff35543c304e8a191c64f35cf3">ec_master_num_devices</a>(domain-&gt;<a class="code" href="structec__domain.html#a58e4f4b7d54f30e58c7187268c1525c1">master</a>); dev_idx++) {</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;            <a class="code" href="datagram_8c.html#ab55ab76a42b6153c3bb98f513b4f9450">ec_datagram_lrd</a>(&amp;pair-&gt;<a class="code" href="structec__datagram__pair__t.html#a3984a280ea726795e9402bc7363d05ed">datagrams</a>[dev_idx], logical_offset,</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;                    data_size);</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;        }</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        pair-&gt;<a class="code" href="structec__datagram__pair__t.html#aa6e12e670f12a511f108b9cd7974f1ce">expected_working_counter</a> = used[<a class="code" href="group__ApplicationInterface.html#gga703c4e47384b3601e7605d6d910aaba1a6b3c6b53010076d846724fec434512e4">EC_DIR_INPUT</a>];</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    }</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    <span class="keywordflow">for</span> (dev_idx = <a class="code" href="globals_8h.html#ad1a2101422888687598d7e1a630c6343a6cc7c24499003f339df547ab73605f13">EC_DEVICE_MAIN</a>;</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;            dev_idx &lt; <a class="code" href="master_8h.html#a27e6deff35543c304e8a191c64f35cf3">ec_master_num_devices</a>(domain-&gt;<a class="code" href="structec__domain.html#a58e4f4b7d54f30e58c7187268c1525c1">master</a>); dev_idx++) {</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;        <a class="code" href="datagram_8c.html#a56f873f563806b58344e8d5da6b0a53d">ec_datagram_zero</a>(&amp;pair-&gt;<a class="code" href="structec__datagram__pair__t.html#a3984a280ea726795e9402bc7363d05ed">datagrams</a>[dev_idx]);</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    }</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;out_datagrams:</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="keywordflow">for</span> (dev_idx = <a class="code" href="globals_8h.html#ad1a2101422888687598d7e1a630c6343a6cc7c24499003f339df547ab73605f13">EC_DEVICE_MAIN</a>;</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;            dev_idx &lt; <a class="code" href="master_8h.html#a27e6deff35543c304e8a191c64f35cf3">ec_master_num_devices</a>(domain-&gt;<a class="code" href="structec__domain.html#a58e4f4b7d54f30e58c7187268c1525c1">master</a>); dev_idx++) {</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;        <a class="code" href="datagram_8c.html#ac4bb8c0e9a5ac20a8d2c31f34a7fc4a9">ec_datagram_clear</a>(&amp;pair-&gt;<a class="code" href="structec__datagram__pair__t.html#a3984a280ea726795e9402bc7363d05ed">datagrams</a>[dev_idx]);</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    }</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    <span class="keywordflow">return</span> ret;</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;}</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;</div><div class="line"><a name="l00151"></a><span class="lineno"><a class="line" href="datagram__pair_8h.html#ac3ff7374f362ab7e2990346186202b71">  151</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="datagram__pair_8c.html#ac6dfb578451de0209688b3e500234c5b">ec_datagram_pair_clear</a>(</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;        <a class="code" href="structec__datagram__pair__t.html">ec_datagram_pair_t</a> *pair </div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;        )</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;{</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dev_idx;</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    <span class="keywordflow">for</span> (dev_idx = <a class="code" href="globals_8h.html#ad1a2101422888687598d7e1a630c6343a6cc7c24499003f339df547ab73605f13">EC_DEVICE_MAIN</a>;</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;            dev_idx &lt; <a class="code" href="master_8h.html#a27e6deff35543c304e8a191c64f35cf3">ec_master_num_devices</a>(pair-&gt;<a class="code" href="structec__datagram__pair__t.html#aaaa75d1c846028cdd78be790c82a9e31">domain</a>-&gt;<a class="code" href="structec__domain.html#a58e4f4b7d54f30e58c7187268c1525c1">master</a>);</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;            dev_idx++) {</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;        <a class="code" href="datagram_8c.html#ac4bb8c0e9a5ac20a8d2c31f34a7fc4a9">ec_datagram_clear</a>(&amp;pair-&gt;<a class="code" href="structec__datagram__pair__t.html#a3984a280ea726795e9402bc7363d05ed">datagrams</a>[dev_idx]);</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    }</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;<span class="preprocessor">#if EC_MAX_NUM_DEVICES &gt; 1</span></div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    <span class="keywordflow">if</span> (pair-&gt;send_buffer) {</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;        kfree(pair-&gt;send_buffer);</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    }</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;}</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;</div><div class="line"><a name="l00176"></a><span class="lineno"><a class="line" href="datagram__pair_8h.html#a58f5dc413c70031fda65e18fe696682b">  176</a></span>&#160;uint16_t <a class="code" href="datagram__pair_8c.html#a073fc0e7c0806c498bc0ea4bf869fdf5">ec_datagram_pair_process</a>(</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;        <a class="code" href="structec__datagram__pair__t.html">ec_datagram_pair_t</a> *pair, </div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;        uint16_t wc_sum[] </div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;        )</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;{</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dev_idx;</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    uint16_t pair_wc = 0;</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    <span class="keywordflow">for</span> (dev_idx = 0; dev_idx &lt; <a class="code" href="master_8h.html#a27e6deff35543c304e8a191c64f35cf3">ec_master_num_devices</a>(pair-&gt;<a class="code" href="structec__datagram__pair__t.html#aaaa75d1c846028cdd78be790c82a9e31">domain</a>-&gt;<a class="code" href="structec__domain.html#a58e4f4b7d54f30e58c7187268c1525c1">master</a>);</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;            dev_idx++) {</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;        <a class="code" href="structec__datagram__t.html">ec_datagram_t</a> *datagram = &amp;pair-&gt;<a class="code" href="structec__datagram__pair__t.html#a3984a280ea726795e9402bc7363d05ed">datagrams</a>[dev_idx];</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;        <a class="code" href="datagram_8c.html#a89bbb5e33d0b78760734a3984e4e394f">ec_datagram_output_stats</a>(datagram);</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;        <span class="keywordflow">if</span> (datagram-&gt;<a class="code" href="structec__datagram__t.html#a90d55e568be4b8464e9725c105d6c4b0">state</a> == <a class="code" href="datagram_8h.html#ac9882419ec1404dcca75761c4d1ce720a95630d1e98f6217bf0392b4295c5bc6a">EC_DATAGRAM_RECEIVED</a>) {</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;            pair_wc += datagram-&gt;<a class="code" href="structec__datagram__t.html#a1eeebb1d33d0dbf47498dd78a966977d">working_counter</a>;</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;            wc_sum[dev_idx] += datagram-&gt;<a class="code" href="structec__datagram__t.html#a1eeebb1d33d0dbf47498dd78a966977d">working_counter</a>;</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;        }</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;    }</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;    <span class="keywordflow">return</span> pair_wc;</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;}</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;</div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;<span class="comment">/*****************************************************************************/</span></div><div class="ttc" id="globals_8h_html_ac67cff75d900b9f1112a4c1a635e495d"><div class="ttname"><a href="globals_8h.html#ac67cff75d900b9f1112a4c1a635e495d">EC_DATAGRAM_NAME_SIZE</a></div><div class="ttdeci">#define EC_DATAGRAM_NAME_SIZE</div><div class="ttdoc">Size of the datagram description string. </div><div class="ttdef"><b>Definition:</b> <a href="globals_8h_source.html#l00116">globals.h:116</a></div></div>
<div class="ttc" id="structec__datagram__pair__t_html"><div class="ttname"><a href="structec__datagram__pair__t.html">ec_datagram_pair_t</a></div><div class="ttdoc">Domain datagram pair. </div><div class="ttdef"><b>Definition:</b> <a href="datagram__pair_8h_source.html#l00049">datagram_pair.h:49</a></div></div>
<div class="ttc" id="structec__datagram__pair__t_html_aa6e12e670f12a511f108b9cd7974f1ce"><div class="ttname"><a href="structec__datagram__pair__t.html#aa6e12e670f12a511f108b9cd7974f1ce">ec_datagram_pair_t::expected_working_counter</a></div><div class="ttdeci">unsigned int expected_working_counter</div><div class="ttdoc">Expectord working conter. </div><div class="ttdef"><b>Definition:</b> <a href="datagram__pair_8h_source.html#l00056">datagram_pair.h:56</a></div></div>
<div class="ttc" id="master_8h_html_a27e6deff35543c304e8a191c64f35cf3"><div class="ttname"><a href="master_8h.html#a27e6deff35543c304e8a191c64f35cf3">ec_master_num_devices</a></div><div class="ttdeci">#define ec_master_num_devices(MASTER)</div><div class="ttdoc">Number of Ethernet devices. </div><div class="ttdef"><b>Definition:</b> <a href="master_8h_source.html#l00328">master.h:328</a></div></div>
<div class="ttc" id="datagram_8c_html_a5ccd1a04e0901c0bc716b4d7f3dd676d"><div class="ttname"><a href="datagram_8c.html#a5ccd1a04e0901c0bc716b4d7f3dd676d">ec_datagram_lwr_ext</a></div><div class="ttdeci">int ec_datagram_lwr_ext(ec_datagram_t *datagram, uint32_t offset, size_t data_size, uint8_t *external_memory)</div><div class="ttdoc">Initializes an EtherCAT LWR datagram with external memory. </div><div class="ttdef"><b>Definition:</b> <a href="datagram_8c_source.html#l00518">datagram.c:518</a></div></div>
<div class="ttc" id="structec__datagram__t_html"><div class="ttname"><a href="structec__datagram__t.html">ec_datagram_t</a></div><div class="ttdoc">EtherCAT datagram. </div><div class="ttdef"><b>Definition:</b> <a href="datagram_8h_source.html#l00087">datagram.h:87</a></div></div>
<div class="ttc" id="structec__datagram__t_html_af2690854e7fb1c410aa37a1ed225836d"><div class="ttname"><a href="structec__datagram__t.html#af2690854e7fb1c410aa37a1ed225836d">ec_datagram_t::name</a></div><div class="ttdeci">char name[EC_DATAGRAM_NAME_SIZE]</div><div class="ttdoc">Description of the datagram. </div><div class="ttdef"><b>Definition:</b> <a href="datagram_8h_source.html#l00112">datagram.h:112</a></div></div>
<div class="ttc" id="structec__datagram__t_html_a1eeebb1d33d0dbf47498dd78a966977d"><div class="ttname"><a href="structec__datagram__t.html#a1eeebb1d33d0dbf47498dd78a966977d">ec_datagram_t::working_counter</a></div><div class="ttdeci">uint16_t working_counter</div><div class="ttdoc">Working counter. </div><div class="ttdef"><b>Definition:</b> <a href="datagram_8h_source.html#l00099">datagram.h:99</a></div></div>
<div class="ttc" id="globals_8h_html_ab60dd3400b4ae7f326c3edb327505829"><div class="ttname"><a href="globals_8h.html#ab60dd3400b4ae7f326c3edb327505829">ec_device_names</a></div><div class="ttdeci">const char * ec_device_names[2]</div><div class="ttdoc">Device names. </div><div class="ttdef"><b>Definition:</b> <a href="module_8c_source.html#l00458">module.c:458</a></div></div>
<div class="ttc" id="datagram_8c_html_a89bbb5e33d0b78760734a3984e4e394f"><div class="ttname"><a href="datagram_8c.html#a89bbb5e33d0b78760734a3984e4e394f">ec_datagram_output_stats</a></div><div class="ttdeci">void ec_datagram_output_stats(ec_datagram_t *datagram)</div><div class="ttdoc">Outputs datagram statistics at most every second. </div><div class="ttdef"><b>Definition:</b> <a href="datagram_8c_source.html#l00619">datagram.c:619</a></div></div>
<div class="ttc" id="datagram_8c_html_aadace5dd3018b8cbcd8f3905a086ea9d"><div class="ttname"><a href="datagram_8c.html#aadace5dd3018b8cbcd8f3905a086ea9d">ec_datagram_lwr</a></div><div class="ttdeci">int ec_datagram_lwr(ec_datagram_t *datagram, uint32_t offset, size_t data_size)</div><div class="ttdoc">Initializes an EtherCAT LWR datagram. </div><div class="ttdef"><b>Definition:</b> <a href="datagram_8c_source.html#l00452">datagram.c:452</a></div></div>
<div class="ttc" id="master_8h_html"><div class="ttname"><a href="master_8h.html">master.h</a></div><div class="ttdoc">EtherCAT master structure. </div></div>
<div class="ttc" id="datagram_8c_html_a56f873f563806b58344e8d5da6b0a53d"><div class="ttname"><a href="datagram_8c.html#a56f873f563806b58344e8d5da6b0a53d">ec_datagram_zero</a></div><div class="ttdeci">void ec_datagram_zero(ec_datagram_t *datagram)</div><div class="ttdoc">Fills the datagram payload memory with zeros. </div><div class="ttdef"><b>Definition:</b> <a href="datagram_8c_source.html#l00178">datagram.c:178</a></div></div>
<div class="ttc" id="structec__datagram__t_html_a90d55e568be4b8464e9725c105d6c4b0"><div class="ttname"><a href="structec__datagram__t.html#a90d55e568be4b8464e9725c105d6c4b0">ec_datagram_t::state</a></div><div class="ttdeci">ec_datagram_state_t state</div><div class="ttdoc">State. </div><div class="ttdef"><b>Definition:</b> <a href="datagram_8h_source.html#l00100">datagram.h:100</a></div></div>
<div class="ttc" id="datagram__pair_8c_html_a073fc0e7c0806c498bc0ea4bf869fdf5"><div class="ttname"><a href="datagram__pair_8c.html#a073fc0e7c0806c498bc0ea4bf869fdf5">ec_datagram_pair_process</a></div><div class="ttdeci">uint16_t ec_datagram_pair_process(ec_datagram_pair_t *pair, uint16_t wc_sum[])</div><div class="ttdoc">Process received data. </div><div class="ttdef"><b>Definition:</b> <a href="datagram__pair_8c_source.html#l00176">datagram_pair.c:176</a></div></div>
<div class="ttc" id="globals_8h_html_ad1a2101422888687598d7e1a630c6343"><div class="ttname"><a href="globals_8h.html#ad1a2101422888687598d7e1a630c6343">ec_device_index_t</a></div><div class="ttdeci">ec_device_index_t</div><div class="ttdoc">Master devices. </div><div class="ttdef"><b>Definition:</b> <a href="globals_8h_source.html#l00201">globals.h:201</a></div></div>
<div class="ttc" id="datagram__pair_8c_html_ac6dfb578451de0209688b3e500234c5b"><div class="ttname"><a href="datagram__pair_8c.html#ac6dfb578451de0209688b3e500234c5b">ec_datagram_pair_clear</a></div><div class="ttdeci">void ec_datagram_pair_clear(ec_datagram_pair_t *pair)</div><div class="ttdoc">Datagram pair destructor. </div><div class="ttdef"><b>Definition:</b> <a href="datagram__pair_8c_source.html#l00151">datagram_pair.c:151</a></div></div>
<div class="ttc" id="structec__domain_html_ac341000021b5790693cc74f7687fb956"><div class="ttname"><a href="structec__domain.html#ac341000021b5790693cc74f7687fb956">ec_domain::index</a></div><div class="ttdeci">unsigned int index</div><div class="ttdoc">Index (just a number). </div><div class="ttdef"><b>Definition:</b> <a href="domain_8h_source.html#l00058">domain.h:58</a></div></div>
<div class="ttc" id="globals_8h_html_ad1a2101422888687598d7e1a630c6343a6cc7c24499003f339df547ab73605f13"><div class="ttname"><a href="globals_8h.html#ad1a2101422888687598d7e1a630c6343a6cc7c24499003f339df547ab73605f13">EC_DEVICE_MAIN</a></div><div class="ttdoc">Main device. </div><div class="ttdef"><b>Definition:</b> <a href="globals_8h_source.html#l00202">globals.h:202</a></div></div>
<div class="ttc" id="datagram_8c_html_a5469e87537d8c03970d1981984cf4b38"><div class="ttname"><a href="datagram_8c.html#a5469e87537d8c03970d1981984cf4b38">ec_datagram_lrd_ext</a></div><div class="ttdeci">int ec_datagram_lrd_ext(ec_datagram_t *datagram, uint32_t offset, size_t data_size, uint8_t *external_memory)</div><div class="ttdoc">Initializes an EtherCAT LRD datagram with external memory. </div><div class="ttdef"><b>Definition:</b> <a href="datagram_8c_source.html#l00493">datagram.c:493</a></div></div>
<div class="ttc" id="master_8h_html_aece1fb7ea6af168ba7513c9d7b0a523a"><div class="ttname"><a href="master_8h.html#aece1fb7ea6af168ba7513c9d7b0a523a">EC_MASTER_ERR</a></div><div class="ttdeci">#define EC_MASTER_ERR(master, fmt, args...)</div><div class="ttdoc">Convenience macro for printing master-specific errors to syslog. </div><div class="ttdef"><b>Definition:</b> <a href="master_8h_source.html#l00085">master.h:85</a></div></div>
<div class="ttc" id="group__ApplicationInterface_html_gga703c4e47384b3601e7605d6d910aaba1a6b3c6b53010076d846724fec434512e4"><div class="ttname"><a href="group__ApplicationInterface.html#gga703c4e47384b3601e7605d6d910aaba1a6b3c6b53010076d846724fec434512e4">EC_DIR_INPUT</a></div><div class="ttdoc">Values read by the master. </div><div class="ttdef"><b>Definition:</b> <a href="ecrt_8h_source.html#l00420">ecrt.h:420</a></div></div>
<div class="ttc" id="structec__datagram__t_html_a9804c4ebdbd3e7ff5b55bfe3aa33bbef"><div class="ttname"><a href="structec__datagram__t.html#a9804c4ebdbd3e7ff5b55bfe3aa33bbef">ec_datagram_t::device_index</a></div><div class="ttdeci">ec_device_index_t device_index</div><div class="ttdoc">Device via which the datagram shall be / was sent. </div><div class="ttdef"><b>Definition:</b> <a href="datagram_8h_source.html#l00090">datagram.h:90</a></div></div>
<div class="ttc" id="datagram_8c_html_ab55ab76a42b6153c3bb98f513b4f9450"><div class="ttname"><a href="datagram_8c.html#ab55ab76a42b6153c3bb98f513b4f9450">ec_datagram_lrd</a></div><div class="ttdeci">int ec_datagram_lrd(ec_datagram_t *datagram, uint32_t offset, size_t data_size)</div><div class="ttdoc">Initializes an EtherCAT LRD datagram. </div><div class="ttdef"><b>Definition:</b> <a href="datagram_8c_source.html#l00433">datagram.c:433</a></div></div>
<div class="ttc" id="datagram_8c_html_a407dc1f0c4247f84e4193b4368be8a8b"><div class="ttname"><a href="datagram_8c.html#a407dc1f0c4247f84e4193b4368be8a8b">ec_datagram_prealloc</a></div><div class="ttdeci">int ec_datagram_prealloc(ec_datagram_t *datagram, size_t size)</div><div class="ttdoc">Allocates internal payload memory. </div><div class="ttdef"><b>Definition:</b> <a href="datagram_8c_source.html#l00150">datagram.c:150</a></div></div>
<div class="ttc" id="datagram__pair_8c_html_a0b3a11d04d7bcb1f5db4187ff628d4bd"><div class="ttname"><a href="datagram__pair_8c.html#a0b3a11d04d7bcb1f5db4187ff628d4bd">ec_datagram_pair_init</a></div><div class="ttdeci">int ec_datagram_pair_init(ec_datagram_pair_t *pair, ec_domain_t *domain, uint32_t logical_offset, uint8_t *data, size_t data_size, const unsigned int used[])</div><div class="ttdoc">Datagram pair constructor. </div><div class="ttdef"><b>Definition:</b> <a href="datagram__pair_8c_source.html#l00048">datagram_pair.c:48</a></div></div>
<div class="ttc" id="structec__datagram__pair__t_html_aaaa75d1c846028cdd78be790c82a9e31"><div class="ttname"><a href="structec__datagram__pair__t.html#aaaa75d1c846028cdd78be790c82a9e31">ec_datagram_pair_t::domain</a></div><div class="ttdeci">ec_domain_t * domain</div><div class="ttdoc">Parent domain. </div><div class="ttdef"><b>Definition:</b> <a href="datagram__pair_8h_source.html#l00051">datagram_pair.h:51</a></div></div>
<div class="ttc" id="datagram_8c_html_af3dd26022b8780648d2f96ef558f0657"><div class="ttname"><a href="datagram_8c.html#af3dd26022b8780648d2f96ef558f0657">ec_datagram_init</a></div><div class="ttdeci">void ec_datagram_init(ec_datagram_t *datagram)</div><div class="ttdoc">Constructor. </div><div class="ttdef"><b>Definition:</b> <a href="datagram_8c_source.html#l00088">datagram.c:88</a></div></div>
<div class="ttc" id="structec__datagram__pair__t_html_a8b2eafeceb6565bfe2d0c2363679ba1e"><div class="ttname"><a href="structec__datagram__pair__t.html#a8b2eafeceb6565bfe2d0c2363679ba1e">ec_datagram_pair_t::list</a></div><div class="ttdeci">struct list_head list</div><div class="ttdoc">List header. </div><div class="ttdef"><b>Definition:</b> <a href="datagram__pair_8h_source.html#l00050">datagram_pair.h:50</a></div></div>
<div class="ttc" id="datagram__pair_8h_html"><div class="ttname"><a href="datagram__pair_8h.html">datagram_pair.h</a></div><div class="ttdoc">EtherCAT datagram pair structure. </div></div>
<div class="ttc" id="datagram_8c_html_a28e3b0846186d09fbb8c4166c4a6eaba"><div class="ttname"><a href="datagram_8c.html#a28e3b0846186d09fbb8c4166c4a6eaba">ec_datagram_lrw_ext</a></div><div class="ttdeci">int ec_datagram_lrw_ext(ec_datagram_t *datagram, uint32_t offset, size_t data_size, uint8_t *external_memory)</div><div class="ttdoc">Initializes an EtherCAT LRW datagram with external memory. </div><div class="ttdef"><b>Definition:</b> <a href="datagram_8c_source.html#l00543">datagram.c:543</a></div></div>
<div class="ttc" id="structec__datagram__pair__t_html_a3984a280ea726795e9402bc7363d05ed"><div class="ttname"><a href="structec__datagram__pair__t.html#a3984a280ea726795e9402bc7363d05ed">ec_datagram_pair_t::datagrams</a></div><div class="ttdeci">ec_datagram_t datagrams[EC_MAX_NUM_DEVICES]</div><div class="ttdoc">Datagrams. </div><div class="ttdef"><b>Definition:</b> <a href="datagram__pair_8h_source.html#l00052">datagram_pair.h:52</a></div></div>
<div class="ttc" id="globals_8h_html_ad1a2101422888687598d7e1a630c6343ab269739586dbb817c1e0ff42e74c5111"><div class="ttname"><a href="globals_8h.html#ad1a2101422888687598d7e1a630c6343ab269739586dbb817c1e0ff42e74c5111">EC_DEVICE_BACKUP</a></div><div class="ttdoc">Backup device. </div><div class="ttdef"><b>Definition:</b> <a href="globals_8h_source.html#l00203">globals.h:203</a></div></div>
<div class="ttc" id="group__ApplicationInterface_html_gga703c4e47384b3601e7605d6d910aaba1aebf26f1d5c09cf002af5b09d9cb59b78"><div class="ttname"><a href="group__ApplicationInterface.html#gga703c4e47384b3601e7605d6d910aaba1aebf26f1d5c09cf002af5b09d9cb59b78">EC_DIR_OUTPUT</a></div><div class="ttdoc">Values written by the master. </div><div class="ttdef"><b>Definition:</b> <a href="ecrt_8h_source.html#l00419">ecrt.h:419</a></div></div>
<div class="ttc" id="datagram_8h_html_ac9882419ec1404dcca75761c4d1ce720a95630d1e98f6217bf0392b4295c5bc6a"><div class="ttname"><a href="datagram_8h.html#ac9882419ec1404dcca75761c4d1ce720a95630d1e98f6217bf0392b4295c5bc6a">EC_DATAGRAM_RECEIVED</a></div><div class="ttdoc">Received (dequeued). </div><div class="ttdef"><b>Definition:</b> <a href="datagram_8h_source.html#l00078">datagram.h:78</a></div></div>
<div class="ttc" id="datagram_8c_html_ae8724f060b07cdbed10a0e264d066094"><div class="ttname"><a href="datagram_8c.html#ae8724f060b07cdbed10a0e264d066094">ec_datagram_lrw</a></div><div class="ttdeci">int ec_datagram_lrw(ec_datagram_t *datagram, uint32_t offset, size_t data_size)</div><div class="ttdoc">Initializes an EtherCAT LRW datagram. </div><div class="ttdef"><b>Definition:</b> <a href="datagram_8c_source.html#l00471">datagram.c:471</a></div></div>
<div class="ttc" id="structec__domain_html"><div class="ttname"><a href="structec__domain.html">ec_domain</a></div><div class="ttdoc">EtherCAT domain. </div><div class="ttdef"><b>Definition:</b> <a href="domain_8h_source.html#l00054">domain.h:54</a></div></div>
<div class="ttc" id="structec__domain_html_a58e4f4b7d54f30e58c7187268c1525c1"><div class="ttname"><a href="structec__domain.html#a58e4f4b7d54f30e58c7187268c1525c1">ec_domain::master</a></div><div class="ttdeci">ec_master_t * master</div><div class="ttdoc">EtherCAT master owning the domain. </div><div class="ttdef"><b>Definition:</b> <a href="domain_8h_source.html#l00057">domain.h:57</a></div></div>
<div class="ttc" id="datagram_8c_html_ac4bb8c0e9a5ac20a8d2c31f34a7fc4a9"><div class="ttname"><a href="datagram_8c.html#ac4bb8c0e9a5ac20a8d2c31f34a7fc4a9">ec_datagram_clear</a></div><div class="ttdeci">void ec_datagram_clear(ec_datagram_t *datagram)</div><div class="ttdoc">Destructor. </div><div class="ttdef"><b>Definition:</b> <a href="datagram_8c_source.html#l00118">datagram.c:118</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_c1346cf4828efdd0d2baf0d391d01b77.html">master</a></li><li class="navelem"><a class="el" href="datagram__pair_8c.html">datagram_pair.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
